package com.industrial.operation.controller;


import com.industrial.common.core.web.domain.AjaxResult;
import com.industrial.common.security.annotation.RequiresPermissions;
import com.industrial.operation.domain.SysDataReportingFile;
import com.industrial.operation.service.ISysDataReportingFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/reporting/file")

public class SysDataReportingFileController {

    @Autowired
    private ISysDataReportingFileService sysDataReportingFileService;

    @RequiresPermissions("operation:file:save")
    @PostMapping("/saveFileInfo")
    public AjaxResult saveFileInfo(@Validated @RequestBody SysDataReportingFile sysDataReportingFile){
        return sysDataReportingFileService.saveFileInfo(sysDataReportingFile);
    }

    @GetMapping("/{pkId}")
    public AjaxResult getFileInfoByPkId(@PathVariable("pkId") String pkId){
        return sysDataReportingFileService.getFileInfoByPkId(pkId);
    }

    @DeleteMapping("/deleteFileInfoById")
    public AjaxResult deleteFileInfoById(@RequestBody SysDataReportingFile sysDataReportingFile){
        return sysDataReportingFileService.deleteFileInfoById(sysDataReportingFile);
    }
}
